<template>
  <div>
    <h2>App组件</h2>
    <h2>msg: {{ msg }}</h2>
    <hr />
    <A ref="AComp"></A>
    <hr />
    <B></B>
  </div>
</template>
<script>
import A from "./components/A.vue";
import B from "./components/B.vue";
export default {
  name: "App",
  data() {
    return {
      msg: "hello",
    };
  },
  methods: {},
  components: {
    A,
    B,
  },
  mounted() {
    // 获取所有的子组件实例
    // console.log(this.$children);
    console.log(this.$refs.AComp);
  },
};
</script>

<style lang="less" scoped></style>
